﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace ThongBao
{
    public partial class FrmThongBaoOkCancel : Office2007Form
    {
        public FrmThongBaoOkCancel()
        {
            InitializeComponent();
        }

        public static FrmThongBaoOkCancel ThongbaoOkCencel;

        public static bool ok = false, cencel = false;

        /// <summary>
        /// Tạo thông báo
        /// </summary>
        /// <param name="_TenTB">Tên thông báo</param>
        /// <param name="_NoiDung">Nội dung</param>
        /// <param name="_HinhAnh">Hình ảnh ứng với thông báo: 1 Giúp đỡ || 2 Lỗi || 3 Thông tin || 4 Check </param>
        public static void TaoThongBaoOkCencel(string _TenTB, string _NoiDung, int _HinhAnh)
        {
            ThongbaoOkCencel = new FrmThongBaoOkCancel();
            ThongbaoOkCencel.ptbGiupDo.Visible = false;
            ThongbaoOkCencel.ptbLoi.Visible = false;
            ThongbaoOkCencel.ptbThongTin.Visible = false;
            ThongbaoOkCencel.ptCheck.Visible = false;

            ThongbaoOkCencel.Text = _TenTB;

            ThongbaoOkCencel.lblNoiDung.Text = _NoiDung;

            switch (_HinhAnh)
            {
                case 1:
                    ThongbaoOkCencel.ptbGiupDo.Visible = true;
                    break;
                case 2:
                    ThongbaoOkCencel.ptbLoi.Visible = true;
                    break;
                case 3:
                    ThongbaoOkCencel.ptbThongTin.Visible = true;
                    break;
                case 4:
                    ThongbaoOkCencel.ptCheck.Visible = true;
                    break;
            }

            ThongbaoOkCencel.ShowDialog();
        }

        public event Delegate

        private void btnOK_Click(object sender, EventArgs e)
        {
            ok = true;
            Close();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            cencel = true;
            Close();
        }

        private void FrmThongBaoOkCancel_Resize(object sender, EventArgs e)
        {

        }

        private void FrmThongBaoOkCancel_FormClosed(object sender, FormClosedEventArgs e)
        {
            cencel = true;
        }
    }
}
